/**
 * 
 */
package io.dora.remoting;

import io.dora.base.Protocol;

import java.util.Map;


/**
 * 服务端提供端Server
 *
 * @author zhaohongbo
 */
public abstract class AbstractProviderServer implements ProviderServer {

	/** 协议 */
	protected Protocol protocol;

	/** 服务列表 */
	protected Map<String, Object> serviceMap;
	
	public AbstractProviderServer(Protocol protocol) {
		this.protocol = protocol;
	}

	@Override
	public void start() {
		doServerStart();
	}

	@Override
	public void stop() {
		doServerStop();
	}

	@Override
	public void load(Map<String, Object> serviceMap) {
		this.serviceMap = serviceMap;
	}
	
	public Map<String, Object> getServiceMap() {
		return serviceMap;
	}
	
	public Protocol getProtocol() {
		return protocol;
	}

	public void setProtocol(Protocol protocol) {
		this.protocol = protocol;
	}

	/**
	 * 启动服务端
	 */
	public abstract void doServerStart();

	/**
	 * 停止服务端
	 */
	public abstract void doServerStop();

}
